# -*- coding: utf-8 -*-
# @Time        :2025/3/13 9:56
# @Author      :文刀水寿
# @File        : 35_爬虫_requests_代理.py
"""
 @Description :
"""
import requests

url = 'http://www.baidu.com/s'

headers = {
    'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0",
}

data = {
    'wd': 'ip'
}

proxy = {
    'http': '218.87.205.116:21281'
}

response = requests.get(url=url, params=data, headers=headers, proxies=proxy)

content = response.text

with open('ip1.html', 'w', encoding='utf-8') as fp:
    fp.write(content)
